package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.ClearOrderSettingService;
import com.itheima.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisPool;

import java.util.Date;

/*
    实现清理过去的预约设置表
 */


@Controller

public class ClearOrderSettingJob {

  @Reference
  private ClearOrderSettingService clearOrderSettingService;

  public void clearOrderSetting() throws Exception {

    System.out.println("定时删除...");
    String day = DateUtils.parseDate2String(new Date());

    clearOrderSettingService.deleteOrderSetting(day);
  }
}

